#!/bin/bash
web_path=$(cd `dirname $0`; pwd)
envir=0
echo -n -e "\033[31mInitializing envirenment... \n Choose which envirenment you like? \n(1. database-local, 2. database-develop, 3. database-staging, 4. database-product)... \033[0m"
while true; do
    read answer
    if [ "$answer" == 1 ]; then
        envir=1
        break
    elif [ "$answer" == 2 ]; then
        envir=2
        break
    elif [ "$answer" == 3 ]; then
        envir=3
        break
    elif [ "$answer" == 4 ]; then
        envir=4
        break
    elif [ "$answer" == "yes" ]; then
        exit 4
    fi
    echo -n "(1. database-local, 2. database-staging, 3. database-online)... "
done

if [ "$envir" == 4 ]; then
    $(`cp .env-product .env`)
elif [ "$envir" == 3 ]; then
    $(`cp .env-staging .env`)
elif [ "$envir" == 2 ]; then
    $(`cp .env-develop .env`)
else
    $(`cp .env-local .env`)
fi


